#include <iostream>
#include <string>
#include <cmath>

int main(int argc, char *argv[]) {
  if(argc < 4) {
    std::cout << "usage: number operation number\n";
    return 1;
  } else {
    bool boolResult;
    float result;
    if (std::string(argv[2]) == std::string("+")) {
      result = std::stof(argv[1]) + std::stof(argv[3]);
    } else if (std::string(argv[2]) == std::string("-")) {
      result = std::stof(argv[1]) - std::stof(argv[3]);
    } else if (std::string(argv[2]) == std::string("/")) {
      result = std::stof(argv[1]) / std::stof(argv[3]);
    } else if (std::string(argv[2]) == std::string("*")) {
      result = std::stof(argv[1]) * std::stof(argv[3]);
    } 
    
    if (std::string(argv[2]) == std::string("<")) {
      boolResult = std::stof(argv[1]) < std::stof(argv[3]);
    } else if (std::string(argv[2]) == std::string(">")) {
      boolResult = std::stof(argv[1]) > std::stof(argv[3]);
    } else if (std::string(argv[2]) == std::string("<=")) {
      boolResult = std::stof(argv[1]) <= std::stof(argv[3]);
    } else if (std::string(argv[2]) == std::string(">=")) {
      boolResult = std::stof(argv[1]) >= std::stof(argv[3]);
    } else if (std::string(argv[2]) == std::string("==")) {
      boolResult = std::stof(argv[1]) <= std::stof(argv[3]);
    } else {
      if (argc > 4) {
        if (std::string(argv[4]) == std::string("abs")) {
          result = std::abs(result);
        } else if (std::string(argv[4]) == std::string("floor")) {
          result = (float) std::floor(result);
        } else if (std::string(argv[4]) == std::string("ceil")) {
          result = (float) std::ceil(result);
        } else if (std::string(argv[4]) == std::string("round")) {
          result = (float) std::round(result);
        } else if (std::string(argv[4]) == std::string("sign")) {
          if(result < 0) {
            result = -1;
          } else if(result > 0) {
            result = 1;
          } else {
            result = 0;
          }
        }
      }
      std::cout << result << "\n";
      return 0;
    }

    if (boolResult) {
      return 0;
    } else {
      return 1;
    }

  }
  return 0;
}
